package cloudPayAdmin.admin.service.traffic;

import cloudPayAdmin.admin.dbapp.entity.traffic.TToken;
import cloudPayAdmin.admin.dbapp.repo.traffic.TokenRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class TokenService {

    @Autowired
    TokenRepo tokenRepo;

    @Transactional(readOnly = true)
    public List<TToken> findByTypeAndEnable(String type, boolean enable){
       return tokenRepo.findByTypeAndEnable(type, enable);
    }

    public void saveToken(TToken token){
        tokenRepo.save(token);
    }
}
